package io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;

public class OosDemo {
    public static void main(String[] args) throws IOException {
        String name="计算机";
        int age=25;
        String gender="未知";
        String [] otherInfo={"**?*****"};
        Student j=new Student(name,age,gender,otherInfo);
        System.out.println(j);
        FileOutputStream fos=new FileOutputStream("student.obj");
        ObjectOutputStream oos=new ObjectOutputStream(fos);
        oos.writeObject(j);
        System.out.println("写出完毕");
        oos.close();

    }
}
